package com.itheima.lj;

import android.app.Activity;
import android.app.FragmentManager;
import android.os.Bundle;

import com.itheima.lj.fragment.NewsFragment;

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //通过片段管理器来添加片段
        FragmentManager fragmentManager = getFragmentManager();
        NewsFragment newsFragment=new NewsFragment();
        fragmentManager.beginTransaction().replace(R.id.flt_content,newsFragment,"NEWS").commit();
    }
}
